package cn.iocoder.yudao.module.product.dal.mysql.calculation;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.product.dal.dataobject.calculation.CalculationDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.product.controller.admin.calculation.vo.*;

/**
 * 产品碳核算 Mapper
 *
 * @author wcl
 */
@Mapper
public interface CalculationMapper extends BaseMapperX<CalculationDO> {

    default PageResult<CalculationDO> selectPage(CalculationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CalculationDO>()
                .likeIfPresent(CalculationDO::getName, reqVO.getName())
                .betweenIfPresent(CalculationDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CalculationDO::getId));
    }

}
